package com.xinli.xinlifm.http.bean.find;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.xinli.xinlifm.view.activity.find.FindSecondActivity;

import java.util.List;

/**
 * Created by zz on 16-10-13.
 */

public class FindCircleBean {

    /**
     * code : 0
     * count : 62
     * data : [{"flag":4,"title":"认知疗法","name":"认知疗法","count":0,"sort":29,"id":77,"cover":"http://image.xinli001.com/20160222/113621ixyl0a80mvu8mv1i.jpg"},{"flag":4,"title":"论人的成长","name":"论人的成长","count":0,"sort":28,"id":74,"cover":"http://image.xinli001.com/20160205/0703256zi3l5vludvp0usu.jpg"},{"flag":4,"title":"精神分析入门","name":"精神分析入门","count":0,"sort":26,"id":73,"cover":"http://image.xinli001.com/20160129/091443a2dn2t03dclm21lg.jpg"},{"flag":4,"title":"精神分析治疗指南","name":"精神分析治疗指南","count":0,"sort":25,"id":72,"cover":"http://image.xinli001.com/20160129/091205oz53ehwev9ps0r8a.jpg"},{"flag":4,"title":"前世今生","name":"前世今生","count":0,"sort":24,"id":71,"cover":"http://image.xinli001.com/20160106/095206tw1i1mieun5r0z3f.jpg"}]
     */

    private int code;
    private int count;
    /**
     * flag : 4
     * title : 认知疗法
     * name : 认知疗法
     * count : 0
     * sort : 29
     * id : 77
     * cover : http://image.xinli001.com/20160222/113621ixyl0a80mvu8mv1i.jpg
     */

    private List<DataBean> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean implements View.OnClickListener {
        private int flag;
        private String title;
        private String name;
        private int count;
        private int sort;
        private int id;
        private String cover;

        public int getFlag() {
            return flag;
        }

        public void setFlag(int flag) {
            this.flag = flag;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }

        public int getSort() {
            return sort;
        }

        public void setSort(int sort) {
            this.sort = sort;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getCover() {
            return cover;
        }

        public void setCover(String cover) {
            this.cover = cover;
        }

        @Override
        public void onClick(View v) {
            Toast.makeText(v.getContext(), getCover(), Toast.LENGTH_SHORT).show();

            Intent intent = new Intent(v.getContext(), FindSecondActivity.class);
            intent.putExtra("tag",getName());
            intent.putExtra("type",1);
            v.getContext().startActivity(intent);
        }
    }
}
